Function: empty(domElement, boolAlsoRemoveParent) Description: Removes all DOM nodes and associated data contained within an element. Returns: domElement, null, or $A object if chained. Note: All attached event handlers and data bindings are also removed to prevent memory leaks. When boolAlsoRemoveParent is false or undefined, the referenced element is returned when processing is complete. when boolAlsoRemoveParent is true however, the referenced element is also removed, and a null reference is returned instead. Use of the boolAlsoRemoveParent parameter performs the same action as the remove() function. Example: // Empty a DOM element and remove all associated event bindings and data var myElement = $A.empty(domElement); // Remove a DOM element and remove all associated event bindings and data $A.empty(domElement, true); // Or the same using chaining // Empty a DOM element and remove all associated event bindings and data var myChain = $A(domElement).empty(); // Remove a DOM element and remove all associated event bindings and data $A(domElement).empty(true); // To return the modified element within a chain, use the "return()" method. var myElement = myChain.return();